namespace HZY.Framework.Repository.EntityFramework.Attributes;

/// <summary>
/// 用于给实体打上标记后，可以自动映射数据
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class DictAttribute(string tableName, string codeName, string textName) : Attribute
{
    /// <summary>
    /// 表名称
    /// </summary>
    public string TableName { get; set; } = tableName;

    /// <summary>
    /// 字典编码
    /// </summary>
    public string CodeName { get; set; } = codeName;

    /// <summary>
    /// 字典显示文本
    /// </summary>
    public string TextName { get; set; } = textName;

    /// <summary>
    /// 赋给哪个字段
    /// </summary>
    public string? ToField { get; set; }

    /// <summary>
    /// 标识
    /// </summary>
    public string? Mark { get; set; }
}